package javapoker;
import java.util.Random;import java.util.ArrayList;
public class Talia {
    public static ArrayList<Karta> karty;

     Talia()
    {
        karty = new ArrayList<Karta>(36);
        int index_1, index_2;
        Random generator = new Random();
        Karta temp;

        for (short a=0; a<=3; a++)
        {
            for (short b=0; b<=12; b++)
             {
               karty.add( new Karta(a,b) );
             }
        }

        int size = karty.size() -1;
        

        for (short i=0; i<200; i++)
        {
            index_1 = generator.nextInt( size );
            index_2 = generator.nextInt( size );

            temp = (Karta) karty.get( index_2 );
            karty.set( index_2 , karty.get( index_1 ) );
            karty.set( index_1, temp );
        }
    }


 
    public Karta drawFromDeck()
    {       
        return karty.remove( karty.size()-1 );
    }

    public  int getTotalkarty()
    {
        return karty.size();
        
    }
}